DAY17:A Needle in the Haystack


Posted by birdbirdmurmur on 2023-07-31

題目連結

A Needle in the Haystack

解法

function findNeedle(haystack) {
  return "found the needle at position " + haystack.indexOf("needle");
}

筆記

如何快速找到陣列中的索引? indexOf()
直接返回字串


#javascript #Codewars #indexOf







Related Posts

C 語言練習程式(2) -- 指標相關程式集錦

C 語言練習程式(2) -- 指標相關程式集錦

AppWorks School Batch #16 Front-End Class 學習筆記&心得(駐點階段四:個人專案~Sprint 2)

AppWorks School Batch #16 Front-End Class 學習筆記&心得(駐點階段四:個人專案~Sprint 2)

Command Line 基本指令

Command Line 基本指令


Comments